<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>  
<%@ page import="kr.cadis.clms.dao.AbsenceDao, kr.cadis.clms.model.Absence, java.sql.Date" %>    
<%
	int noPerson = Integer.parseInt(request.getParameter("noPerson"));
	Date startDate = Date.valueOf(request.getParameter("startDate"));
	Date finishDate = Date.valueOf(request.getParameter("finishDate"));
	
	Absence absence = new Absence();
	absence.setNoPerson(noPerson);
	absence.setStartDate(startDate);
	absence.setFinishDate(finishDate);
	
	AbsenceDao absenceDao = new AbsenceDao();
	boolean bf = absenceDao.insert(absence);
	
	if(bf == true) {
%>
<script type="text/javascript">
<!--
		window.location.href = "List.jsp?noPerson=<%= absence.getNoPerson() %>";
//-->
</script>
<%		
	}
	else {		
%>
<script type="text/javascript">
<!--
		alert("사용자 정보를  DB 에 입력하는 데 오류가 있습니다.");
		window.location.href = "List.jsp?noPerson=<%= absence.getNoPerson() %>";
//-->
</script>
<%		
	}
%>